/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.deployment.manager.create;

import br.com.deployment.daoImpl.CityDAOImpl;
import br.com.deployment.entities.City;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author ely
 */
@ManagedBean
@SessionScoped
public class ManagerCreateAddress {

    @EJB
    CityDAOImpl cityService;

    public ManagerCreateAddress() {
    }
    
    // Ato Complento para Cidade
    public List<City> completeCity(String query) {
        List<City> bd = new ArrayList<City>();
        City city = new City();
        city.setName(query);
   
        try {
            bd = cityService.findCity(city);
        } catch (Exception ex) {
            Logger.getLogger(ManagerCreateAddress.class.getName()).log(Level.SEVERE, null, ex);
}
        return bd;
    }
}
